﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class UserSelectCommandHandler : IRequestHandler<UserSelectCommand, UserPage>
    {
        private readonly IUserService _userService;

        public UserSelectCommandHandler(IUserService userService)
        {
            _userService = userService;
        }

        public async Task<UserPage> Handle(UserSelectCommand request, CancellationToken cancellationToken)
        {
            return await _userService.GetUserInfo(request.pageindex, request.pagesize, request.UName);
        }
    }
}
